<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div>
    email:<input type="text" id="email" value="foo@bar.com"><br/>
    password:<input type="text" id="password" value="abc123"><br/>
    <button id="register">register</button>
    <button id="login">login</button>
</div>

<script src="/js/jquery.js"></script>
<script src="/js/index.js"></script>
<script>
    function simpleCb(err, data) {
        if (err)console.log(err);
        else console.log(data);
    }
    $('#login').on('click', function () {
        var email = $('#email').val();
        var password = $('#password').val();
        login(email, password, simpleCb);
    });

    $('#register').on('click', function () {
        var email = $('#email').val();
        var password = $('#password').val();
        register(email, password, simpleCb);
    });
</script>

</body>
</html>